﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GCommon
{
    public static class SingletonModuleAppContext
    {
        static private List<ISingletonModule> Modules = new List<ISingletonModule>();
        static internal void RegisterModule(ISingletonModule module)
        {
            Modules.Add(module);
        }
        static public void InitModules()
        {
            foreach (ISingletonModule s in Modules)
            {
                s.Init();
            }
        }
        static public void CleanupModules()
        {
            foreach(ISingletonModule s in Modules)
            {
                s.Cleanup();
            }
        }
    }
}
